package simulacao.util;

import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.Group;
import javafx.scene.text.Text;

public class ToolTip extends CustomNode {

    public var texto : String;
    public var x : Float;
    public var y : Float;
    public var visivel : Boolean;

    public override function create(): Node{

        println("criaando tooltip {texto} posicao {x} , {y}, visivel: {visible}");

        return Group{
                    content: [
                            Rectangle {
                                fill:Color.KHAKI
                                height:20
                                width:160
                            },
                            Text {
                                content: bind texto;
                                layoutX:10
                                layoutY:15
                            }
                        ]

                    layoutX: bind x + 10
                    layoutY: bind y - 20
                    visible: bind visivel
                }
    }
}
